package dcedit.util;

// Import Java SDK Classes
import java.awt.Component;
import javax.swing.BoxLayout;
import javax.swing.JPanel;

/**
 * The DCVerticalPanel class.
 * @author dca
 */
public class DCVerticalPanel extends JPanel {
   /** Serial Version UID version for serializable classes */
   public static final long serialVersionUID = 1318004033052L;

   /** Constructor */
   public DCVerticalPanel() {
      super();
      this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
   } // END constructor

   /** add method */
   @Override
   public Component add(Component comp)  {
      final JPanel PANEL = new JPanel();
      PANEL.add(comp);
      super.add(PANEL);
      return comp;
   } // END add method

   /** add method */
   @Override
   public Component add(Component comp, int index)  {
      final JPanel PANEL = new JPanel();
      PANEL.add(comp);
      super.add(PANEL, index);
      return comp;
   } // END add method

   /** add method */
   @Override
   public void add(Component comp, Object constraints)  {
      final JPanel PANEL = new JPanel();
      PANEL.add(comp);
      super.add(PANEL, constraints);
   } // END add method

   /** add method */
   @Override
   public void add(Component comp, Object constraints, int index)  {
      final JPanel PANEL = new JPanel();
      PANEL.add(comp);
      super.add(PANEL, constraints, index);
   } // END add method

   /** add method */
   @Override
   public Component add(String name, Component comp)  {
      final JPanel PANEL = new JPanel();
      PANEL.add(comp);
      super.add(name, PANEL);
      return comp;
   } // END add method
} // END class DCVerticalPanel
